//logs.js
const util = require('../../utils/util.js')

Page({
  data: {
    showCity:false,
    cityName:'上海'
  },
  changeCity:function(){
    this.setData({
      showCity: !this.data.showCity
    })
  },
  cityTap:function(e){
    const cityName = e.detail.cityname;
    this.setData({
      cityName: cityName,
      showCity: false
    })

  },
  goChoose:function(){
    wx.navigateTo({
      url: '../choose/choose'
    })
  },
  onLoad: function () {
    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return util.formatTime(new Date(log))
      })
    })
  }
})
